package dubbo.server4.impl.controller;

import dubbo.server4.impl.kafka.KafkaSender;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/kafka")
public class KafkaController extends BaseController{
    private Logger logger = Logger.getLogger(HelloWordController.class);
    @Autowired
    private KafkaSender kafkaSender;
    @RequestMapping("/send")
    public void send() {
        String msg="我是Kafka消息！";
        kafkaSender.sendMsg(msg);
        logger.info("KafkaController.send 消息已经发送!msg="+msg);
    }
}
